import * as types from '../_types/exchangeBalance';

interface IState{
    [key: string]: any
}

const initialState = {
    amountToCny: 53211,
}


export default function updateBalance(state:IState = initialState, action) {
    const {type, payload} = action;
    switch (type) {
        case types.EXCHANGE_UPDATE_BALANCEINFO: {
            return {
                ...state,
                ...payload
            }
        }
        case types.EXCHANGE_LOGOUT: {
            return {};
        }
        case types.EXCHANGE_DEL_BALANCEINFO: {
            return {};
        }
        // case types.EXCHANGE_UPDATE_BALANCEINFO_WITH_COINTYPE: {
        //     const {coinType, amount} = action;

        // }
        default: {
            return state;
        }
    }
}